<html>
<head><meta charset="utf-8"><title>Reproducing perf result locally · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html">Reproducing perf result locally</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230643987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230643987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230643987">(Mar 17 2021 at 06:24)</a>:</h4>
<p>How do I reproduce the results reported here <a href="https://perf.rust-lang.org/compare.html?start=4d76b4ca52a65d63ab83d82d6630f1df8ec05a93&amp;end=f42888c15fd370b8bca4c5646ffc3aac3005dca8&amp;stat=max-rss">https://perf.rust-lang.org/compare.html?start=4d76b4ca52a65d63ab83d82d6630f1df8ec05a93&amp;end=f42888c15fd370b8bca4c5646ffc3aac3005dca8&amp;stat=max-rss</a> locally?</p>
<p>Relatedly, what is a good way of getting a type's size in the compiler? I could add a print in <code>main</code>, but I think I won't have access to the type from the driver.</p>



<a name="230646453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230646453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230646453">(Mar 17 2021 at 07:04)</a>:</h4>
<p>You can use <code>static_assert_size</code>. There is a bunch of them at the bottom of rustc_hir::hir.</p>



<a name="230647535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230647535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230647535">(Mar 17 2021 at 07:20)</a>:</h4>
<p>reproducing perf.rlo results: the collector can be ran locally, but it's just running rustc under perf for one the included benchmarks. some docs on how to use it to profile a local build: <a href="https://github.com/rust-lang/rustc-perf/tree/master/collector#profiling-local-builds">https://github.com/rust-lang/rustc-perf/tree/master/collector#profiling-local-builds</a></p>



<a name="230647673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230647673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230647673">(Mar 17 2021 at 07:21)</a>:</h4>
<p>getting a type's size: maybe<code>-Zprint-type-sizes</code> will work in your case</p>



<a name="230819323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230819323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230819323">(Mar 18 2021 at 06:34)</a>:</h4>
<p>Thanks. Which profiler (self-profile, time-passes etc.) do I use for the max RSS metric?</p>



<a name="230870888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Reproducing%20perf%20result%20locally/near/230870888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Reproducing.20perf.20result.20locally.html#230870888">(Mar 18 2021 at 14:19)</a>:</h4>
<p>I think you need to use <code>perf</code> for that? it should say in <a href="https://github.com/rust-lang/rustc-perf/tree/master/collector">https://github.com/rust-lang/rustc-perf/tree/master/collector</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>